<?php

// Functions for processing form related data

function sanitizeData($r) {
	global $connection;
	if(is_array($r)) {
		foreach($r as $n=>$v) {
			$r[$n] = sanitizeData($v);
		}
	} else {
		$r = htmlspecialchars(mysqli_real_escape_string($connection, $r));
	}
	
	return $r;
}

function mysqlDate($date) {
	return $date;
	$split = explode("-",$date);
	return $split[2].'-'.$split[0].'-'.$split[1];
}

function phpDate($mysqlDate) {
	$split = explode("-",$mysqlDate);
	return $split[2].'-'.$split[0].'-'.$split[1];
}


?>
